#pragma once

#include <stdio.h>

namespace db
{
    struct MemoryBlock {
        char* data;
        size_t size, position;
        MemoryBlock(size_t sz) :size(sz), position(0) {
            data = (char*)malloc(size);
        }
    
        void write(const void* w_data, size_t size)
        {
            memcpy(data + position, w_data, size);
            position += size;
        }

        ~MemoryBlock()
        {
            free(data);
        }
    };

};